package com.yunkaweilai.android.view.dialog.guadan;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.flyco.dialog.utils.CornerUtils;
import com.flyco.dialog.widget.base.BaseDialog;
import com.github.lazylibrary.util.ToastUtils;
import com.yunkaweilai.android.R;
import com.yunkaweilai.android.activity.member.MemberInfoListActivity;
import com.yunkaweilai.android.constants.Api;
import com.yunkaweilai.android.constants.CommonConstants;
import com.yunkaweilai.android.interfaces.DialogPayInterface;
import com.yunkaweilai.android.model.Event;
import com.yunkaweilai.android.model.member.MemberHeadModel;
import com.yunkaweilai.android.net.HttpRequest;
import com.yunkaweilai.android.net.PostProcess;
import com.yunkaweilai.android.utils.Utils;
import com.yunkaweilai.android.view.MyToast;

import org.greenrobot.eventbus.EventBus;

/**
 * 再次挂单
 * Created by Administrator on 2016/12/22 0022.
 */

public class GuadanNextDialog extends BaseDialog<GuadanNextDialog> {
    ImageView idImgClose;
    private TextView idTvContent;
    private TextView idTvClose;
    private TextView idTvRight;
    private DialogPayInterface dialogPayInterface;
    public GuadanNextDialog(Context context, DialogPayInterface dialogPayInterface) {
        super(context);
        this.dialogPayInterface = dialogPayInterface;
    }

    @Override
    public View onCreateView() {
        widthScale(0);
        //showAnim(new Swing());
        //dismissAnim(this, new ZoomOutExit());
        View inflate = View.inflate(mContext, R.layout.dialog_member_status, null);
        idImgClose = (ImageView) inflate.findViewById(R.id.id_img_close);
        idTvContent = ((TextView) inflate.findViewById(R.id.id_tv_content));
        idTvRight = ((TextView) inflate.findViewById(R.id.id_tv_right));
        idTvClose = (TextView) inflate.findViewById(R.id.id_tv_close);
        idTvContent.setText("是否确认添加商品？");
        //设置背景颜色，和背景的透明圆弧角度
        inflate.setBackgroundDrawable(
                CornerUtils.cornerDrawable(Color.parseColor("#f8f9fa"), dp2px(10)));

        return inflate;
    }

    @Override
    public void setUiBeforShow() {
        idImgClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
        idTvRight.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dialogPayInterface.payMoney();
                dismiss();
            }
        });
        idTvClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }
}
